/*
 * Lenovo Group
 * Copyright (c) 2015-2016 All Rights Reserved.
 * 
 * Project Name:assign-tracer
 * Create Time: 2016年2月24日 下午3:40:44
 */
package com.lenovo.lmrp.server.assigntracer.facade;

import java.util.Objects;

import javax.inject.Inject;

/**
 * 
 * @author wujin
 * @version v1.0
 */
public class FacadeFactory {
    private static FacadeFactory self = new FacadeFactory();
    
    private ITicketNotificationFacade ticketNotificationFacade;
    private IEngineerActionFacade engineerActionFacade;

    public static FacadeFactory getInstance() {
        return self;
    }
    
    public ITicketNotificationFacade getTicketNotificationFacade() {
        if (Objects.isNull(ticketNotificationFacade))
            this.ticketNotificationFacade = new TicketNotificationFacadeImpl();
        return ticketNotificationFacade;
    }
    
    public IEngineerActionFacade getEngineerActionFacade() {
        if (Objects.isNull(engineerActionFacade))
            this.engineerActionFacade = new EngineerActionFacadeImpl();
        return engineerActionFacade;
    }
    
    @Inject
    public void set(ITicketNotificationFacade ticketNotificationFacade) {
        this.ticketNotificationFacade = ticketNotificationFacade;
    }
    
    @Inject
    public void set(IEngineerActionFacade engineerActionFacade) {
        this.engineerActionFacade = engineerActionFacade;
    }
}
